/*
 * @: 
 * @Version: 1.0
 * @Autor: ziwei
 * @Date: 2022-03-10 10:43:48
 * @LastEditors: ziwei
 * @LastEditTime: 2022-03-10 10:47:22
 */
const {createCanvas} = require('canvas')
const fs = require('fs')
const canvas = createCanvas(150,150)
const ctx = canvas.getContext('2d')

ctx.font = '20px Impact'
ctx.strokeStyle = 'red'
ctx.strokeText("hello",0,20)

fs.writeFileSync('result.png',canvas.toBuffer('image/png'))